<template>
  <el-card>
    <div class="box">
      <img :src="userStore.avatar" alt="" class="avatar">
      <div class="bottom">
        <h3 class="title">{{ getTime() }}好{{userStore.username}}</h3>
        <p class="subtitle">V3 Admin</p>
      </div>
    </div>
  </el-card>
  <div class="welcomeImg">
    <svg-icon name="welcome" width="800px" height="500px"></svg-icon>
  </div>
</template>

<script setup lang="ts">
// 引入用户相关的仓库，获取当前用户的头像、昵称
import useUserStore from '@/store/modules/user'
// 引入获取当前时间的函数
import {getTime} from '@/utils/time'
let userStore = useUserStore()
</script>

<style scoped lang="scss">
.box{
  display: flex;
  .avatar{
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }
  .bottom{
    margin-left: 20px;
    .title{
      font-size: 35px;
      margin-bottom: 20px;
    }
    .subtitle{
      font-style: italic;
    }
  }
}
.welcomeImg{
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
</style>